package com.hs.srm.admin.modules.requisition.dao;

import java.util.List;
import java.util.Map;

import com.hs.srm.admin.modules.pricemanagement.vo.EssentialInformationVO;
import com.hs.srm.admin.modules.requisition.entity.NproPurchRequestItemEntity;
import com.hs.srm.admin.modules.requisition.entity.ProPurchRequestItemEntity;
import com.hs.srm.admin.modules.ssess.vo.SsessAndProPurchRequest;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;

/**
 * @author yanfei
 *
 * @date 2019年6月15日
 */
public interface ProPurchRequestItemDao extends BaseMapper<ProPurchRequestItemEntity> {

	List<ProPurchRequestItemEntity> findByNo(@Param("purchRequestCode") String purchRequestCode,@Param("ids") List<String> ids);

	ProPurchRequestItemEntity selectById(@Param("pkId") String pkId);
	List<ProPurchRequestItemEntity> selectBatchIds(@Param("ids")List<String> ids);
	@MapKey("factory")
	List<Map<String,String>> selectUserMapList(@Param("ids")List<String> ids);

	List<ProPurchRequestItemEntity> selectRequestItem();

	boolean updateGoodsStatusBatch(@Param("list") List<ProPurchRequestItemEntity> list);

	boolean updateGoodsStatus(ProPurchRequestItemEntity proPurchRequestItemEntity);

	public List<SsessAndProPurchRequest> selectSsess();

	public List<SsessAndProPurchRequest> selectSsessSimplify();
	//分页查询数据
	public List<ProPurchRequestItemEntity> selectDetailPage(RowBounds rowBounds,
		        @Param("ew") Wrapper<ProPurchRequestItemEntity> wrapper, @Param("params") Map<String, Object> params);

	 boolean updateProPurchRequestItemEntity(ProPurchRequestItemEntity proPurchRequestItemEntity);

	//货源分配从配额取则修改配额数
    boolean updateQuotaNum(EssentialInformationVO essentialInformationVO);
	//修改
	ProPurchRequestItemEntity findbypkId(String pkid);

	int updateStatus(@Param("requestCode")  String requestCode,@Param("purchRequestItemCode")   String purchRequestItemCode);
}
